package ebj.common.multithread.downloader;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;

public class MultiThreadDownloaderTest {
//	private static CommonLogger logger = new CommonLogger(MultiThreadDownloaderTest.class);
	
	public static void main(String[] args) {
		MultiThreadDownloader multiThreadDownloader = new MultiThreadDownloader();
		String url = "http://img.61gequ.com/allimg/2011-4/201142614314278502.jpg";
		String apk_download_url = "http://download.ymtech.com.s3.amazonaws.com/apk_files/com.lazyswipe.apk";
		String apk_download_url2 = "http://dl.bintray.com/jknack/antlr4ide/plugins/antlr4ide.core_0.3.5.jar";
		int threadNum = 5;
		try {
			multiThreadDownloader.download(apk_download_url2, threadNum);
		} catch (IOException e) {
//			logger.error("", e);
			e.printStackTrace();
		}
		
//		try {
//			boolean result = MultiThreadDownloader.fileIsDownloadingCompleted(apk_download_url, new File("com.lazyswipe.apk"));
//			System.out.println(result);
//		} catch (MalformedURLException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//		System.out.println();
	}
}